package com.xiaoxu.spark

import org.apache.spark.sql.SparkSession

/**
  *
  * author: zhangXu
  * createTime: 2018-12-16 
  **/
object SparkSessionDemo {
  def main(args: Array[String]) {

    //http://spark.apache.org/docs/latest/sql-getting-started.html
    val spark = SparkSession.builder().appName("SparkSessionDemo")
      .master("local[2]").getOrCreate()

    val people = spark.read.json("D:/test/data/people.json")
    people.show()

    spark.sqlContext.setConf("spark.sql.shuffle.partitions","10")
    spark.stop()
  }
}
